-
Notifications
You must be signed in to change notification settings - Fork 376
Don't add Hadamards to a user-defined initial state in QAOA #1362
Conversation
Hi @Milos9304, thanks for the contribution! Could you also add a release note saying that you fixed this? 🙂 (And a test of course, but you already mentioned you're working on that) |
… release note for the bugfix.
Done. I am quite confused with some of the unrelated tests failing for weird errors like e.g. ECONNRESET etc. My test in P.S. This is my very first open-source contribution so I apologize if I am doing some mess around here. |
The build system caches the downloaded packages in order to save time on subsequent builds. It seems there was a problem saving the cache. I'll update the branch since the master has had changes done recently and this will start the build again. Sometimes there are problems with the build that are unrelated to what you have done - I can understand how that can be confusing when you first see such things failing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing this fix to Aqua!
…ommunity#1362) * Fixing QAOA initial_state problem * fixing code style warnings * Creating QAOA-initial_state-dont-mix-with-Hadamards bugfix test and a release note for the bugfix. * Removing code that appeared in pull request due to error * Fixing import math error * Fixing code style issues. Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
…ommunity/qiskit-aqua#1362) * Fixing QAOA initial_state problem * fixing code style warnings * Creating QAOA-initial_state-dont-mix-with-Hadamards bugfix test and a release note for the bugfix. * Removing code that appeared in pull request due to error * Fixing import math error * Fixing code style issues. Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
…ommunity/qiskit-aqua#1362) * Fixing QAOA initial_state problem * fixing code style warnings * Creating QAOA-initial_state-dont-mix-with-Hadamards bugfix test and a release note for the bugfix. * Removing code that appeared in pull request due to error * Fixing import math error * Fixing code style issues. Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
…ommunity/qiskit-aqua#1362) * Fixing QAOA initial_state problem * fixing code style warnings * Creating QAOA-initial_state-dont-mix-with-Hadamards bugfix test and a release note for the bugfix. * Removing code that appeared in pull request due to error * Fixing import math error * Fixing code style issues. Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
Summary
initial_state
provided to QAOA gets composed with Hadamard gates, which is an undesired behaviour. I assume this bug is a result of implementation of the case where noinitial_state
is set. In this default case the input state to ansatz circuit is |+++...++> as described in QAOA Farhi's paper, hence the Hadamards.Details and comments
My solution is straightforward and can be easily seen from code. I am working on fixing the tests.